//package com.retailcloud.gateway.config;
//
///**
// * @author wudi
// * @date 2024/11/5
// * @comment
// */
//
//import com.retailcloud.gateway.filter.TokenAuthenticationFilter;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.cloud.gateway.route.RouteLocator;
//import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//public class GatewayConfig {
//
//
//    @Autowired
//    private TokenAuthenticationFilter tokenAuthenticationFilter;
//
//
//    @Bean
//    public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
//        return builder.routes()
//                .route(r -> r.path("/baseService/**")
//                        .filters(f -> f.filter(tokenAuthenticationFilter.apply(TokenAuthenticationFilter.Config.instance)))
//                        .uri("lb://retailcloud-base-service"))
//                .route(r -> r.path("/thirdPartyService/**")
//                        .filters(f -> f.filter(tokenAuthenticationFilter.apply(TokenAuthenticationFilter.Config.instance)))
//                        .uri("lb://retailcloud-third-party-service"))
//                .build();
//    }
//}
